package com.molichuxing;

import java.time.LocalDateTime;

import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;


/**
 * @prouect_name: order-service
 * @class_name: ${CLASS_NAME}
 * @description: ${DESCRIPTION}
 * @author: 林亿建
 * @create_date: 2017年08月07日
 * @modify_date: 2017年08月07日
 **/
public class Provider {
  private static final Logger LOGGER = LoggerFactory.getLogger(Provider.class);

  public static void main(String[] args) throws Exception {
    startService();
    synchronized (Provider.class){
      do {
        try {
          Provider.class.wait();
        } catch (Exception e) {
          LOGGER.error("启动类异常");
        }
      }while(true);
    }
  }

  static void startService() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
    context.start();
    LOGGER.info("{}:服务已启动",LocalDateTime.now());
  }
}

